package com.onland.dfish.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.onland.dfish.entity.Comments;
import com.onland.dfish.mapper.CommentMapper;
import com.onland.dfish.service.ICommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 评论业务层
 */
@Service("commentsService")
public class CommentsServiceImpl implements ICommentsService {
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public int insert(Comments comments) {
        comments.setAddTime(new Date());
        return commentMapper.insert(comments);
    }

    @Override
    public List<Comments> queryComments(int videoId) {
        return commentMapper.queryComments(videoId);
    }
}
